using Circus.Syntax.Lexer;
using System;
using System.ComponentModel;
namespace Circus.Syntax
{
	[DesignerCategory("Code"), ToolboxItem(true)]
	public class HtmlParser : XmlParser
	{
		protected LexerProc lexParamColorProc;
		public override bool CaseSensitive
		{
			get
			{
				return false;
			}
		}
		protected override void InitLanguage()
		{
			this.Scheme.FileType = "html";
		}
		protected virtual int LexParamColor()
		{
			this.currentPos++;
			int length = this.source.Length;
			while (this.currentPos < length)
			{
				char c = this.source[this.currentPos];
				if ((c < '0' || c > '9') && (c < 'a' || c > 'f') && (c < 'A' || c > 'F'))
				{
					break;
				}
				this.currentPos++;
			}
			return 10;
		}
		protected override void InitStyles()
		{
			this.InitDefaultStyles();
		}
		protected override void InitLexer()
		{
			base.InitLexer();
			this.lexParamColorProc = new LexerProc(this.LexParamColor);
			base.RegisterLexerProc(2, '#', this.lexParamColorProc);
		}
		protected override int GetLexerStyle(int token)
		{
			int result;
			if (token != 11)
			{
				result = base.GetLexerStyle(token);
			}
			else
			{
				result = 3;
			}
			return result;
		}
		protected override void ReportXmlError(SyntaxNode node, SyntaxError err)
		{
		}
		public override void ResetAutoIndentChars()
		{
			this.AutoIndentChars = SyntaxConsts.DefaultHtmlAutoIndentChars.ToCharArray();
		}
	}
}
